namespace Oops.Xna.Framework.GameState
{
	/// <summary>
	/// A collection of <see cref="GameScreen"/> instances keyed by their names.
	/// </summary>
	public class GameScreenCollection : KeyedGameComponentCollection<string, GameScreen>
	{
		/// <summary>
		/// Initializes a new instance of the <see cref="GameScreenCollection"/> class.
		/// </summary>
		internal GameScreenCollection() : base() { }

		#region KeyedCollection<TKey, TValue> Members

		protected override string GetKeyForItem(GameScreen item)
		{
			// The game screens are keyed on their names.
			return item.Name;
		}

		#endregion
	}

	/// <summary>
	/// Defines the contract for a game state service.
	/// </summary>
	public interface IGameStateService
	{
		/// <summary>
		/// Gets the previous screen.
		/// </summary>
		GameScreen PreviousScreen { get; }

		/// <summary>
		/// Gets the current screen.
		/// </summary>
		GameScreen CurrentScreen { get; }

		/// <summary>
		/// Gets the associated collection of <see cref="GameScreen"/> instances.
		/// </summary>
		GameScreenCollection Screens { get; }
	}

	internal interface IInternalGameStateService
	{
		GameScreen ActiveScreen { get; }
	}
}
